package cn.fl.riskctrl.jxldb.service.impl;

import java.util.List;

import fl.riskctrl.facade.jxldb.api.IJxldbBatchApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.fl.riskctrl.jxldb.service.IJxldbSearchService;
import cn.fl.riskctrl.jxldb.transform.JxlApplyVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgApplyLVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgApplyVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgBlkDtlVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgBlkVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgIdMpDubtVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgIdNmDubtVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgIdOrgDubtVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgMpIdDubtVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgMpNmDubtVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgMpOrgDubtVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgOrgSrchHisVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgRegStatsVOTransform;
import cn.fl.riskctrl.jxldb.transform.JxlmgReportVOTransform;
import cn.fl.riskctrl.jxldb.vo.JxlApplyVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgApplyLVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgApplyVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgBlkDtlVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgBlkVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgIdMpDubtVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgIdNmDubtVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgIdOrgDubtVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgMpIdDubtVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgMpNmDubtVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgMpOrgDubtVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgOrgSrchHisVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgRegStatsVO;
import cn.fl.riskctrl.jxldb.vo.JxlmgReportVO;
import fl.riskctrl.facade.jxldb.api.IJxldbSearchApiService;
import fl.riskctrl.facade.jxldb.dto.JxlApplyDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgApplyDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgApplyLDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgBlkDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgBlkDtlDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgIdMpDubtDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgIdNmDubtDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgIdOrgDubtDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgMpIdDubtDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgMpNmDubtDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgMpOrgDubtDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgOrgSrchHisDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgRegStatsDTO;
import fl.riskctrl.facade.jxldb.dto.JxlmgReportDTO;

@Service
public class JxldbSearchServiceImpl implements IJxldbSearchService {
	@Autowired
	private IJxldbSearchApiService jxlApplyService;

    @Autowired
    private IJxldbBatchApiService jxldbBatchApiService;
	
	
	@Override
	public Pager searchJxlApply(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlApply(page);
		List<JxlApplyDTO> list = (List<JxlApplyDTO>)pager.getResultList();
		List<JxlApplyVO> voList = JxlApplyVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgApply(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgApply(page);
		List<JxlmgApplyDTO> list = (List<JxlmgApplyDTO>)pager.getResultList();
		List<JxlmgApplyVO> voList = JxlmgApplyVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgApplyL(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgApplyL(page);
		List<JxlmgApplyLDTO> list = (List<JxlmgApplyLDTO>)pager.getResultList();
		List<JxlmgApplyLVO> voList = JxlmgApplyLVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgReport(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgReport(page);
		List<JxlmgReportDTO> list = (List<JxlmgReportDTO>)pager.getResultList();
		List<JxlmgReportVO> voList = JxlmgReportVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgBlk(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgBlk(page);
		List<JxlmgBlkDTO> list = (List<JxlmgBlkDTO>)pager.getResultList();
		List<JxlmgBlkVO> voList = JxlmgBlkVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgBlkDtl(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgBlkDtl(page);
		List<JxlmgBlkDtlDTO> list = (List<JxlmgBlkDtlDTO>)pager.getResultList();
		List<JxlmgBlkDtlVO> voList = JxlmgBlkDtlVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgOrgSrchHis(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgOrgSrchHis(page);
		List<JxlmgOrgSrchHisDTO> list = (List<JxlmgOrgSrchHisDTO>)pager.getResultList();
		List<JxlmgOrgSrchHisVO> voList = JxlmgOrgSrchHisVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgRegStats(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgRegStats(page);
		List<JxlmgRegStatsDTO> list = (List<JxlmgRegStatsDTO>)pager.getResultList();
		List<JxlmgRegStatsVO> voList = JxlmgRegStatsVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgMpIdDubt(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgMpIdDubt(page);
		List<JxlmgMpIdDubtDTO> list = (List<JxlmgMpIdDubtDTO>)pager.getResultList();
		List<JxlmgMpIdDubtVO> voList = JxlmgMpIdDubtVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgIdNmDubt(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgIdNmDubt(page);
		List<JxlmgIdNmDubtDTO> list = (List<JxlmgIdNmDubtDTO>)pager.getResultList();
		List<JxlmgIdNmDubtVO> voList = JxlmgIdNmDubtVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgMpNmDubt(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgMpNmDubt(page);
		List<JxlmgMpNmDubtDTO> list = (List<JxlmgMpNmDubtDTO>)pager.getResultList();
		List<JxlmgMpNmDubtVO> voList = JxlmgMpNmDubtVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgIdMpDubt(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgIdMpDubt(page);
		List<JxlmgIdMpDubtDTO> list = (List<JxlmgIdMpDubtDTO>)pager.getResultList();
		List<JxlmgIdMpDubtVO> voList = JxlmgIdMpDubtVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}

	@Override
	public Pager searchJxlMgMpOrgDubt(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgMpOrgDubt(page);
		List<JxlmgMpOrgDubtDTO> list = (List<JxlmgMpOrgDubtDTO>)pager.getResultList();
		List<JxlmgMpOrgDubtVO> voList = JxlmgMpOrgDubtVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}
	
	@Override
	public Pager searchJxlMgIdOrgDubt(Pager page) throws BaseException {
		if(page == null){
			page = new Pager();
		}
		Pager pager = this.jxlApplyService.searchJxlMgIdOrgDubt(page);
		List<JxlmgIdOrgDubtDTO> list = (List<JxlmgIdOrgDubtDTO>)pager.getResultList();
		List<JxlmgIdOrgDubtVO> voList = JxlmgIdOrgDubtVOTransform.toVOList(list);
		pager.setResultList(voList);
		return pager;
	}
    @Override
    public boolean noTransRskCtrlRecConvertJXLApply() throws BaseException {
        //异步处理
        this.jxldbBatchApiService.noTransRskCtrlRecConvertJXLApply();
        return true;
    }

    @Override
    public boolean noTransJxlmgDistributeData() throws BaseException {
        //异步处理
        this.jxldbBatchApiService.noTransJxlmgDistributeData(null);
        return true;
    }

}
